package com.woniuxy.enjoylife.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.enjoylife.entity.Suggest;
import com.woniuxy.enjoylife.entity.dto.SuggestDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface SuggestMapper extends BaseMapper<Suggest> {
    //全查询投诉，包括用户，小区信息（分页）
    public List<SuggestDto> findAll(int reuid);
    //根据内容模糊查询并分页
    public List<SuggestDto> findLike(@Param("reuid") int reuid, @Param("content") String content);
    //根据投诉id查询uid,cid,再根据uid,cid查询用户，小区信息
    public SuggestDto findSuggestDtoById(int id);

    //***********************用户角度*****************

    //用户查询自己相关的投诉信息
    public List<SuggestDto> findUserSuggest(int uid);

    //新增用户投诉
    public int insertSuggest(Suggest suggest);
}
